<template>
  <view class="content">
    <view class="listcontent" v-for="shop in shops" :key="shop.id">
      <view class="listitem">
        <img class="shop-image" :src="shop.imgUrl" />
      </view>
      <view class="listitem listcon">
        {{shop.name}}
        <view class="listrow">
          <view>月售：{{shop.sales}}</view>
          <view>起送：{{shop.expressLimit}}</view>
          <view>基础运费：{{shop.expressPrice}}</view>
        </view>
        <view class="slogan">{{shop.slogan}}</view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      shops: [],
    }
  },
  onLoad(options) {
    this.shopsdata()
  },
  methods: {
    shopsdata(id) {
      uni.request({
        url: `http://localhost:3000/hotList`,
        success: (res) => {
          this.shops = res.data
        },
      })
    }
  }
};
</script>

<style scoped>
/* 通用图片样式 */
.shop-image {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.content .listcontent {
  margin-top: 20px;
  width: 100%;
  display: flex;
  flex-direction: row;
  border-top: 1px solid #eee;
  margin-left: 20px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.content .listcontent .listitem .listrow {
  display: flex;
  flex-direction: row;
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 14px;
  color: #666;
}

.content .listcontent .listitem .listrow view {
  margin-right: 20px;
}

.content .listcontent .listcon {
  margin-left: 20px;
  font-size: 18px;
  flex: 1;
}

.slogan {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 5px;
}

/* 添加响应式设计 */
@media (max-width: 375px) {
  .shop-image {
    width: 60px;
    height: 60px;
  }
  
  .content .listcontent .listcon {
    font-size: 16px;
  }
  
  .content .listcontent .listitem .listrow view {
    margin-right: 10px;
    font-size: 12px;
  }
}
</style>